//
//  KDWebEditCell.m
//  PublicSentimentMonitorSystem
//
//  Created by 魏强 on 15/11/9.
//  Copyright © 2015年 魏强. All rights reserved.
//

#import "KDWebEditCell.h"
#import "KDWebEditCellModel.h"

@interface KDWebEditCell ()
@property (weak, nonatomic) IBOutlet UILabel *nameLb;
/**
 *  网址label
 */
@property (weak, nonatomic) IBOutlet UILabel *addressLb;

@end
@implementation KDWebEditCell

- (void)awakeFromNib {
    // Initialization code
}
+ (instancetype)cellWithTableView:(UITableView *)tableView{
    static NSString *cellId =@"KDWebEditCell";
    
    UINib *xib = [UINib nibWithNibName:@"KDWebEditCell" bundle:nil];
    [tableView registerNib:xib forCellReuseIdentifier:cellId];
    KDWebEditCell *cell =[tableView dequeueReusableCellWithIdentifier:cellId];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;
    
}
- (void)setModel:(KDWebEditCellModel *)model{
    _model = model;
    self.nameLb.text = model.w_Name;
    self.addressLb.text = model.w_Url;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}
- (IBAction)deleteBtnClick:(UIButton *)sender {

    if (_delegate && [_delegate respondsToSelector:@selector(KDWebEditCell:deleteBtnClickWithModel:)]) {
        [_delegate KDWebEditCell:self deleteBtnClickWithModel:self.model];
    }
}

@end
